package model

import (
	"gorm.io/gorm"
)

// PurchaseAgent 代理
type PurchaseAgent struct {
	Id                  int               `gorm:"column:id;primary_key;AUTO_INCREMENT" form:"id" json:"id"`
	Agent               string            `gorm:"column:agent" form:"agent" json:"agent"`                                             //代理
	AdvanceInterestRate float32           `gorm:"column:advance_interest_rate" form:"advanceInterestRate" json:"advanceInterestRate"` //垫资利率
	PurchaseProduct     []PurchaseProduct `gorm:"ForeignKey:AgentId;AssociationForeignKey:Id" json:"productList"`
	StockNumber         int               `json:"stockNumber"`
	SalesNumber         int               `json:"salesNumber"`
	DivideNumber        int               `json:"divideNumber"`
	TransportNumber     int               `json:"transportNumber"`
}

// PurchaseProductEdit /* 期货/现货基本信息新增
type PurchaseProductEdit struct {
	gorm.Model
	Date              string  `gorm:"date" form:"date" json:"date"`                                                 //订货日期
	AgentId           int     `gorm:"agent_id" form:"agentId" json:"agentId"`                                       //代理id
	ProductId         int     `gorm:"column:product_id" form:"productId" json:"productId"`                          //产品id
	FactoryNo         string  `gorm:"column:factory_no;->" form:"factoryNo" json:"factoryNo"`                       //工厂号
	ProductName       string  `gorm:"column:product_name" form:"productName" json:"productName"`                    //产品名称
	ContractNo        string  `gorm:"column:contract_no" form:"contractNo" json:"contractNo"`                       //合同编号
	ContainerNo       string  `gorm:"column:container_no" form:"containerNo" json:"containerNo"`                    //集装箱号
	FuturesSpot       string  `gorm:"column:futures_spot" form:"futuresSpot" json:"futuresSpot"`                    //期货现货
	ProductPrice      float64 `gorm:"column:product_price" form:"productPrice" json:"productPrice"`                 //单价
	PriceUnit         string  `gorm:"column:price_unit" form:"priceUnit" json:"priceUnit"`                          //单价单位
	ProductWeight     float64 `gorm:"column:product_weight" form:"productWeight" json:"productWeight"`              //重量
	WeightUnit        string  `gorm:"column:weight_unit" form:"weightUnit" json:"weightUnit"`                       //重量单位
	ProductNumber     int     `gorm:"column:product_number" form:"productNumber" json:"productNumber"`              //件数
	InventoryWeight   float64 `gorm:"column:inventory_weight" form:"inventoryWeight" json:"inventoryWeight"`        //重量
	InventoryNumber   int     `gorm:"column:inventory_number" form:"inventoryNumber" json:"inventoryNumber"`        //重量
	ProductTotalPrice float64 `gorm:"column:product_total_price" form:"productTotalPrice" json:"productTotalPrice"` //商品总价
	StartDate         string  `gorm:"column:start_date" form:"startDate" json:"startDate,omitempty"`                //规格
	EndDate           string  `gorm:"column:end_date" form:"endDate" json:"endDate,omitempty"`
	Remark            string  `gorm:"column:remark" form:"remark" json:"remark,omitempty"` //销售单价
}

type PurchaseProductResult struct {
	Id                    uint         `form:"id" json:"id,omitempty"`
	AgentId               int          `form:"agentId" json:"agentId,omitempty"`                             //代理id
	FactoryNo             string       `form:"factoryNo" json:"factoryNo,omitempty"`                         //工厂号
	ProductName           string       `form:"productName" json:"productName,omitempty"`                     //产品名称
	Date                  LocalTime    `form:"date" json:"date,omitempty"`                                   //到港、出库、入库日期
	Agent                 string       `form:"agent" json:"agent,omitempty"`                                 //代理名称
	ContractNo            string       `form:"contractNo" json:"contractNo,omitempty"`                       //合同编号
	ContainerNo           string       `form:"containerNo" json:"containerNo,omitempty"`                     //集装箱号
	FuturesSpot           string       `form:"futuresSpot" json:"futuresSpot,omitempty"`                     //期货现货
	ProductPrice          float64      `form:"productPrice" json:"productPrice,omitempty"`                   //单价
	PriceUnit             string       `form:"priceUnit" json:"priceUnit,omitempty"`                         //单价单位
	ProductWeight         float64      `form:"productWeight" json:"productWeight,omitempty"`                 //重量
	InventoryWeight       float64      `form:"inventoryWeight" json:"inventoryWeight,omitempty"`             //库存重量
	InventoryNumber       int          `form:"inventoryNumber" json:"inventoryNumber,omitempty"`             //库存数量
	WeightUnit            string       `form:"weightUnit" json:"weightUnit,omitempty"`                       //重量单位
	ProductNumber         int          `form:"productNumber" json:"productNumber,omitempty"`                 //件数
	Specification         string       `form:"specification" json:"specification,omitempty"`                 //规格
	StartDate             string       `form:"startDate" json:"startDate,omitempty"`                         //规格
	EndDate               string       `form:"endDate" json:"endDate,omitempty"`                             //规格
	BillTotalAmount       float64      `form:"billTotalAmount" json:"billTotalAmount,omitempty"`             //账单总费用
	SettlementTotalAmount float64      `form:"settlementTotalAmount" json:"settlementTotalAmount,omitempty"` //结算总金额
	SalesTotalAmount      float64      `form:"salesTotalAmount" json:"salesTotalAmount,omitempty"`           //销售总金额
	Profit                float64      `form:"profit" json:"profit,omitempty"`                               //利润
	SalesPrice            float64      `form:"salesPrice" json:"salesPrice,omitempty"`                       //销售单价
	ClearanceFee          string       `form:"clearanceFee" json:"clearanceFee,omitempty"`                   //销售单价
	FeeDifference         float64      `form:"feeDifference" json:"feeDifference,omitempty"`                 //清单费用与实际付款费用差额
	IsDeclaration         bool         `form:"isDeclaration" json:"isDeclaration,omitempty"`                 //是否有报关单
	IsQuarantine          bool         `form:"isQuarantine" json:"isQuarantine,omitempty"`                   //是否有检疫
	ShippingStatus        int          `form:"shippingStatus" json:"shippingStatus,omitempty"`               //船务状态
	ShippingStatusStr     string       `form:"shippingStatusStr" json:"shippingStatusStr,omitempty"`         //船务状态
	ShippingDate          LocalTime    `form:"shippingDate" json:"shippingDate,omitempty"`                   //船务时间
	Port                  string       `form:"port" json:"port,omitempty"`                                   //冷库位置
	ColdStorage           string       `form:"coldStorage" json:"coldStorage,omitempty"`                     //冷库位置
	Balance               string       `form:"balance" json:"balance,omitempty"`
	Deposit               string       `form:"deposit" json:"deposit,omitempty"`
	Clearance             string       `form:"clearance" json:"clearance,omitempty"`
	DepositStatus         int          `form:"depositStatus" json:"depositStatus"`
	BalanceStatus         int          `form:"balanceStatus" json:"balanceStatus"`
	ClearanceStatus       int          `form:"clearanceStatus" json:"clearanceStatus"`
	UnitPrice             float64      `form:"unitPrice" json:"unitPrice"`
	FuturesFee            []FuturesFee `json:"futuresFeeList,omitempty"`
	//清关费用
}

// PurchaseProduct 采购商品
type PurchaseProduct struct {
	gorm.Model
	Date                  LocalTime        `gorm:"date" form:"date" json:"date,omitempty"`                                          //代理id
	AgentId               int              `gorm:"agent_id" form:"agentId" json:"agentId,omitempty"`                                //代理id
	ProductId             int              `gorm:"column:product_id" form:"productId" json:"productId,omitempty"`                   //产品id
	FactoryNo             string           `gorm:"column:factory_no;->" form:"factoryNo" json:"factoryNo,omitempty"`                //
	Agent                 string           `gorm:"column:agent;->" form:"agent" json:"agent,omitempty"`                             //代理名称
	ProductName           string           `gorm:"column:product_name" form:"productName" json:"productName,omitempty"`             //产品名称
	ContractNo            string           `gorm:"column:contract_no" form:"contractNo" json:"contractNo,omitempty"`                //合同编号
	ContainerNo           string           `gorm:"column:container_no" form:"containerNo" json:"containerNo,omitempty"`             //集装箱号
	FuturesSpot           string           `gorm:"column:futures_spot" form:"futuresSpot" json:"futuresSpot,omitempty"`             //期货现货
	ProductPrice          float64          `gorm:"column:product_price" form:"productPrice" json:"productPrice,omitempty"`          //单价
	PriceUnit             string           `gorm:"column:price_unit" form:"priceUnit" json:"priceUnit,omitempty"`                   //单价单位
	ProductWeight         float64          `gorm:"column:product_weight" form:"productWeight" json:"productWeight,omitempty"`       //重量
	InventoryWeight       float64          `gorm:"column:inventory_weight" form:"inventoryWeight" json:"inventoryWeight,omitempty"` //库存重量
	InventoryNumber       int              `gorm:"column:inventory_number" form:"inventoryNumber" json:"inventoryNumber,omitempty"` //库存数量
	WeightUnit            string           `gorm:"column:weight_unit" form:"weightUnit" json:"weightUnit,omitempty"`                //重量单位
	ProductNumber         int              `gorm:"column:product_number" form:"productNumber" json:"productNumber,omitempty"`       //件数
	StartDate             string           `gorm:"column:start_date" form:"startDate" json:"startDate,omitempty,omitempty"`         //规格
	EndDate               string           `gorm:"column:end_date" form:"endDate" json:"endDate,omitempty,omitempty"`
	Specification         string           `gorm:"column:specification;->" form:"specification" json:"specification,omitempty"`                        //规格
	ProductTotalPrice     float64          `gorm:"column:product_total_price" form:"productTotalPrice" json:"productTotalPrice,omitempty"`             //商品总价
	BillTotalAmount       float64          `gorm:"column:bill_total_amount" form:"billTotalAmount" json:"billTotalAmount,omitempty"`                   //账单总费用
	SettlementTotalAmount float64          `gorm:"column:settlement_total_amount" form:"settlementTotalAmount" json:"settlementTotalAmount,omitempty"` //结算总金额
	SalesTotalAmount      float64          `gorm:"column:sales_total_amount" form:"salesTotalAmount" json:"salesTotalAmount,omitempty"`                //销售总金额
	SalesCustomer         string           `gorm:"column:sales_customer" form:"salesCustomer" json:"salesCustomer,omitempty,omitempty"`                //客户
	SalesPrice            float64          `gorm:"column:sales_price" form:"salesPrice" json:"salesPrice,omitempty"`                                   //销售单价
	ClearanceFee          string           `gorm:"column:clearance_fee" form:"clearanceFee" json:"clearanceFee,omitempty"`                             //销售单价
	FeeDifference         float64          `gorm:"column:fee_difference" form:"feeDifference" json:"feeDifference,omitempty"`                          //清单费用与实际付款费用差额
	Remark                string           `gorm:"column:remark" form:"remark" json:"remark,omitempty"`                                                //销售单价
	TaxFee                *TaxFee          `gorm:"ForeignKey:PurchaseProductId;AssociationForeignKey:Id" json:"taxFee,omitempty"`                      //税款
	ShippingInfo          *ShippingInfo    `gorm:"ForeignKey:PurchaseProductId;AssociationForeignKey:Id" json:"shippingInfo,omitempty"`                //船务信息
	FuturesFee            []FuturesFee     `gorm:"ForeignKey:PurchaseProductId;AssociationForeignKey:Id" json:"futuresFeeList,omitempty"`              //期货费用清单
	FinancingFee          []FinancingFee   `gorm:"ForeignKey:PurchaseProductId;AssociationForeignKey:Id" json:"financingFeeList,omitempty"`            //期货费用清单
	StorageFee            []StorageFee     `gorm:"ForeignKey:PurchaseProductId;AssociationForeignKey:Id" json:"storageFeeList,omitempty"`              //仓储费
	SettlementBill        []SettlementBill `gorm:"ForeignKey:PurchaseProductId;AssociationForeignKey:Id" json:"settlementFeeList,omitempty"`           //结算单
	BankStatement         []BankStatement  `gorm:"ForeignKey:FunctionId;AssociationForeignKey:Id" json:"bankStatementList,omitempty"`                  //结算单
	PurchaseSales         []PurchaseSales  `gorm:"ForeignKey:PurchaseProductId;AssociationForeignKey:Id" json:"purchaseSalesList,omitempty"`           //港口出售
	FileInfo              []FileInfo       `gorm:"ForeignKey:Identification;AssociationForeignKey:Id" json:"fileList,omitempty"`                       //相关文件
	ClearanceFeeList      []ClearanceFee   `gorm:"-" json:"clearanceFeeList,omitempty"`                                                                //清关费用
	FeeType               string           `gorm:"->" form:"feeType" json:"feeType,omitempty"`
	DepositStatus         int              `gorm:"->" form:"depositStatus" json:"depositStatus,omitempty"`
	BalanceStatus         int              `gorm:"->" form:"balanceStatus" json:"balanceStatus,omitempty"`
	ClearanceStatus       int              `gorm:"->" form:"clearanceStatus" json:"clearanceStatus,omitempty"`
}

// FuturesFee 期货费用
type FuturesFee struct {
	gorm.Model
	PurchaseProductId uint    `gorm:"purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`  //采购的商品id
	FeeType           string  `gorm:"column:fee_type" form:"feeType" json:"feeType"`                          //费用类型
	Date              string  `gorm:"column:date" form:"date" json:"date"`                                    //日期
	Dollar            float64 `gorm:"column:dollar" form:"dollar" json:"dollar"`                              //美元
	ExchangeRate      float64 `gorm:"column:exchange_rate" form:"exchangeRate" json:"exchangeRate"`           //汇率
	RMB               float64 `gorm:"column:rmb" form:"rmb" json:"rmb"`                                       //美元兑换人民币金额
	HandlingFee       float64 `gorm:"column:handling_fee" form:"handlingFee" json:"handlingFee"`              //手续费
	WireTransferFee   float64 `gorm:"column:wire_transfer_fee" form:"wireTransferFee" json:"wireTransferFee"` //电汇费
	TotalFee          float64 `gorm:"column:total_fee" form:"totalFee" json:"totalFee"`                       //合计费用
	Account           string  `gorm:"column:account" form:"account" json:"account"`                           //付款账户
}

// ClearanceFee /** 清关费用
type ClearanceFee struct {
	Id    int     `json:"id"`
	Name  string  `json:"name"`
	Value float32 `json:"value"`
}

// Financing  /** 融资金额
type Financing struct {
	gorm.Model
	ContainerNo       string  `gorm:"column:container_no" form:"containerNo" json:"containerNo"` //集装箱号
	PurchaseProductId int     `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	SettlementDate    string  `gorm:"column:settlement_date" form:"settlementDate" json:"settlementDate"`
	FinancingRate     float64 `gorm:"column:financing_rate" form:"financingRate" json:"financingRate"`
	FinancingAmount   float64 `gorm:"column:financing_amount" form:"financingAmount" json:"financingAmount"`
	DepositDifference float64 `gorm:"column:deposit_difference" form:"depositDifference" json:"depositDifference"`
	DepositDays       int     `gorm:"column:deposit_days" form:"depositDays" json:"depositDays"`
	DepositInterest   float64 `gorm:"column:deposit_interest" form:"depositInterest" json:"depositInterest"`
	BalanceDifference float64 `gorm:"column:balance_difference" form:"balanceDifference" json:"balanceDifference"`
	BalanceDays       int     `gorm:"column:balance_days" form:"balanceDays" json:"balanceDays"`
	BalanceInterest   float64 `gorm:"column:balance_interest" form:"balanceInterest" json:"balanceInterest"`
	TaxDifference     float64 `gorm:"column:tax_difference" form:"taxDifference" json:"taxDifference"`
	TaxDays           int     `gorm:"column:tax_days" form:"taxDays" json:"taxDays"`
	TaxInterest       float64 `gorm:"column:tax_interest" form:"taxInterest" json:"taxInterest"`
}

type FinancingFee struct {
	gorm.Model
	ContainerNo       string  `gorm:"column:container_no" form:"containerNo" json:"containerNo"` //集装箱号
	PurchaseProductId int     `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	FinancingType     string  `gorm:"column:financing_type" form:"financingType" json:"financingType"`
	FinancingAmount   float64 `gorm:"column:financing_amount" form:"financingAmount" json:"financingAmount"`
	FinancingRate     float64 `gorm:"column:financing_rate" form:"financingRate" json:"financingRate"`
	FinancingInterest float64 `gorm:"column:financing_interest" form:"financingInterest" json:"financingInterest"`
	StartDate         string  `gorm:"column:start_date" form:"startDate" json:"startDate"`
	EndDate           string  `gorm:"column:end_date" form:"endDate" json:"endDate"`
	FinancingDays     int     `gorm:"column:financing_days" form:"financingDays" json:"financingDays"`
}

// SettlementBill /** 结算单
type SettlementBill struct {
	gorm.Model
	UserId            int     `gorm:"column:user_id" form:"userId" json:"userId"`
	PurchaseProductId int     `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	ContainerNo       string  `gorm:"column:container_no" form:"containerNo" json:"containerNo"`
	BankFlowId        int     `gorm:"column:bank_flow_id" form:"bankFlowId" json:"bankFlowId"`
	AccountId         int     `gorm:"column:account_id" form:"accountId" json:"accountId"`
	Date              string  `gorm:"column:date" form:"date" json:"date"`
	Type              string  `gorm:"column:type" form:"type" json:"type"`
	Amount            float32 `gorm:"column:amount" form:"amount" json:"amount"`
	Account           string  `gorm:"column:account" form:"account" json:"account"`
	IsBankData        bool    `gorm:"->" form:"isBankData" json:"isBankData"`
}

// TaxFee /** 税款
type TaxFee struct {
	gorm.Model
	PurchaseProductId int     `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	ContainerNo       string  `gorm:"column:container_no" form:"containerNo" json:"containerNo"` //集装箱号
	Date              string  `gorm:"column:date" form:"date" json:"date"`
	Dollar            float64 `gorm:"column:dollar" form:"dollar" json:"dollar"`
	Rate              float64 `gorm:"column:rate" form:"rate" json:"rate"`
	Tariff            float64 `gorm:"column:tariff" form:"tariff" json:"tariff"`                        //关税
	ValueAddedTax     float64 `gorm:"column:value_added_tax" form:"valueAddedTax" json:"valueAddedTax"` //增值税
	TaxDifference     float64 `gorm:"column:tax_difference" form:"taxDifference" json:"taxDifference"`  //税款差额
	TotalFee          float64 `gorm:"column:total_fee" form:"totalFee" json:"totalFee"`
}

// StorageFee /** 仓储费
type StorageFee struct {
	gorm.Model
	UserId            int     `gorm:"column:user_id" form:"userId" json:"userId"`
	PurchaseProductId int     `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	ContainerNo       string  `gorm:"column:container_no" form:"containerNo" json:"containerNo"` //集装箱号
	Weight            float64 `gorm:"column:weight" form:"weight" json:"weight"`
	StartDate         string  `gorm:"column:start_date" form:"startDate" json:"startDate"`
	EndDate           string  `gorm:"column:end_date" form:"endDate" json:"endDate"`
	Storage           string  `gorm:"column:storage" form:"storage" json:"storage"`
	UnitPrice         float64 `gorm:"column:unit_price" form:"unitPrice" json:"unitPrice"`
	StorageDays       int     `gorm:"column:storage_days" form:"storageDays" json:"storageDays"`
	StorageFee        float64 `gorm:"column:storage_fee" form:"storageFee" json:"storageFee"`
}

// ColdStorage /** 冷库
type ColdStorage struct {
	Id       int     `gorm:"column:id;primary_key;AUTO_INCREMENT" form:"id" json:"id"`
	City     string  `gorm:"column:city" form:"city" json:"city"`
	Storage  string  `gorm:"column:storage" form:"storage" json:"storage"`
	Agent    string  `gorm:"column:agent" form:"agent" json:"agent"`
	Price    float64 `gorm:"column:price" form:"price" json:"price"`
	Position string  `gorm:"column:position" form:"position" json:"position"`
	Lat      float64 `gorm:"column:lat" form:"lat" json:"lat"`
	Lon      float64 `gorm:"column:lon" form:"lon" json:"lon"`
}

// ExchangeRate  /** 海关汇率
type ExchangeRate struct {
	gorm.Model
	Date   string  `gorm:"column:date" form:"date" json:"date"`
	Dollar float64 `gorm:"column:dollar" form:"dollar" json:"dollar"`
	Euro   float64 `gorm:"column:euro" form:"euro" json:"euro"`
}

type KeyField struct {
	Id     int    `gorm:"column:id;primary_key;AUTO_INCREMENT" form:"id" json:"id"`
	Type   string `gorm:"column:type" form:"type" json:"type"`
	Name   string `gorm:"column:name" form:"name" json:"name"`
	Field  string `gorm:"column:field" form:"feeType" json:"field"`
	Sort   string `gorm:"column:sort" form:"sort" json:"sort"`
	IsUsed bool   `gorm:"column:is_used" form:"isUsed" json:"isUsed"`
}

// ShippingInfo /** 船务信息
type ShippingInfo struct {
	gorm.Model
	PurchaseProductId int       `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	ContainerNo       string    `gorm:"container_no" form:"containerNo" json:"containerNo"` //集装箱号
	ShipCompany       string    `gorm:"column:ship_company" form:"shipCompany" json:"shipCompany"`
	Port              string    `gorm:"column:port" form:"port" json:"port"`
	ColdStorage       string    `gorm:"column:cold_storage" form:"coldStorage" json:"coldStorage"`
	StartDate         LocalTime `gorm:"column:start_date" form:"startDate" json:"startDate"`                   //开船时间
	ArrivalDate       LocalTime `gorm:"column:arrival_date" form:"arrivalDate" json:"arrivalDate"`             //到港时间
	WarehousingDate   LocalTime `gorm:"column:warehousing_date" form:"warehousingDate" json:"warehousingDate"` //入库时间
	DeliveryDate      LocalTime `gorm:"column:delivery_date" form:"deliveryDate" json:"deliveryDate"`          //出库时间

}

type ShippingInfoEdit struct {
	gorm.Model
	PurchaseProductId int     `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	ContainerNo       string  `gorm:"container_no;unique" form:"containerNo" json:"containerNo"` //集装箱号
	ShipCompany       string  `gorm:"column:ship_company" form:"shipCompany" json:"shipCompany"`
	Port              string  `gorm:"column:port" form:"port" json:"port"`
	ColdStorage       string  `gorm:"column:cold_storage" form:"coldStorage" json:"coldStorage"`
	StartDate         *string `gorm:"column:start_date" form:"startDate" json:"startDate,omitempty"`                   //到港时间
	ArrivalDate       *string `gorm:"column:arrival_date" form:"arrivalDate" json:"arrivalDate,omitempty"`             //到港时间
	WarehousingDate   *string `gorm:"column:warehousing_date" form:"warehousingDate" json:"warehousingDate,omitempty"` //入库时间
	DeliveryDate      *string `gorm:"column:delivery_date" form:"deliveryDate" json:"deliveryDate,omitempty"`          //出库时间
}

type PurchaseSales struct {
	gorm.Model
	UserId            int             `gorm:"column:user_id" form:"userId" json:"userId"`
	CustomerId        int             `gorm:"column:customer_id" form:"customerId" json:"customerId"`
	PurchaseProductId int             `gorm:"column:purchase_product_id" form:"purchaseProductId" json:"purchaseProductId"`
	InventoryId       int             `gorm:"column:inventory_id" form:"inventoryId" json:"inventoryId"`
	Area              string          `gorm:"column:area" form:"area" json:"area"`
	Car               string          `gorm:"column:car" form:"car" json:"car"`
	SalesNumber       int             `gorm:"column:sales_number" form:"salesNumber" json:"salesNumber"`
	SalesWeight       float64         `gorm:"column:sales_weight" form:"salesWeight" json:"salesWeight"`
	SalesPrice        float64         `gorm:"column:sales_price" form:"salesPrice" json:"salesPrice"`
	TotalPrice        float64         `gorm:"column:total_price" form:"totalPrice" json:"totalPrice"`
	Freight           float64         `gorm:"column:freight" form:"freight" json:"freight"`
	UnloadingFee      float64         `gorm:"column:unloading_fee" form:"unloadingFee" json:"unloadingFee"`
	Remark            string          `gorm:"column:remark" form:"remark" json:"remark"`
	Date              string          `gorm:"column:date" form:"date" json:"date"`
	ProductId         int             `gorm:"column:product_id" form:"productId" json:"productId"`
	Type              string          `gorm:"column:type" form:"type" json:"type"`                                                        //销售出货、入库
	BankStatement     []BankStatement `gorm:"ForeignKey:FunctionId;AssociationForeignKey:Id" format:"statementList" json:"statementList"` //结算单列表

	CustomerName  string `gorm:"column:name;->" form:"customerName" json:"customerName"` //客户名称
	FactoryNo     string `gorm:"->" form:"factoryNo" json:"factoryNo"`                   //工厂号
	ProductName   string `gorm:"->" form:"productName" json:"productName"`               //商品名称
	Specification string `gorm:"->" form:"specification" json:"specification"`           //规格
	ContractNo    string `gorm:"->" form:"contractNo" json:"contractNo"`                 //合同编号
	ContainerNo   string `gorm:"->" form:"containerNo" json:"containerNo"`               //集装箱号
}
